<template>
  <div class="">
    <div class="com-item-page">
      <div v-show="$store.state.dizhiList.length == 0">
        <div class="itemimg">
          <img src="@/assets/img/zanwupinglun.png" alt="" />
        </div>
        <p>暂无收货地址</p>
      </div>
      <div class="item" v-show="$store.state.dizhiList.length > 0">
        <li v-for="item in $store.state.dizhiList" :key="item.id" @click="gotoGwc(item)" >
          <div class="left" @click="gototijiao(item)">
            <img src="../../assets/img/sh1.png" alt="" />
          </div>
          <div class="mid">
            <span style="font-size: 16px">{{ item.user }}</span
            ><span>{{ item.tel }}</span>
            <p>{{ item.ssqsshow }}</p>
          </div>
          <div class="right">
            <div class="btn" @click.stop="edit(item)">编辑</div>
          </div>
        </li>
      </div>
      <div class="footer" style="color: #fff">
        <div style="padding: 8px 16px">
          <van-button @click.native="gotonewdizhi" type="danger" block round>
            添加新地址
          </van-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      key:this.$route.query.key
    };
  },
  mounted() {
    // // console.log(this.objs);
    // this.list.push(this.objs);
    // localStorage.setItem('list',JSON.stringify(this.list))
  },
  created() {
    
  },
  methods: {
    gotonewdizhi() {
      this.$router.push("/classjiadizhi");
    },
    edit(item) {
      this.$router.push({path:"/classjiadizhi",query:{item,type:1}});
    },
    gototijiao(item){
      // console.log(objs);
      this.$router.push({path:"/classtijiao",query:{item:JSON.stringify(item)}})
      // console.log(JSON.stringify(item));
    },
    gotoGwc(item){
    
    }
  },
  components: {},
};
</script>

<style lang='scss' scoped>
.com-item-page {
  height: 700px;
  padding: 15px 5px 0 5px;
  background: #fff;
  position: relative;
  overflow-y: auto;
  h3 {
    font-size: 16px;
    font-weight: normal;
    padding-left: 5px;
  }
  p {
    // width: 77px;
    height: 26px;
    font-size: 15px;
    color: #8c8c8c;
    margin: 15px auto;
    text-align: center;
  }
  .itemimg {
    display: flex;
    justify-content: center;
    img {
      width: 150px;
      height: 150px;
    }
  }
  .footer {
    position: fixed;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 50px;
    padding: 5px 0;
    .van-button {
      height: 36px;
    }
  }
  .item li {
    width: 375px;
    height: 71px;
    padding: 0 15px 20px;
    display: flex;
    list-style: none;
    .left {
      flex-basis: 10%;
      img {
        height: 30px;
        width: 30px;
        // margin-top: 20px;
        margin-right: 10px;
      }
    }
    .mid {
      flex-basis: 60%;
      p {
        margin-top: 3px;
        padding: 0;
        text-align-last: left;
        font-size: 12px;
        color: black;
      }
    }
    .right {
      flex-basis: 30%;
      .btn {
        width: 55px;
        height: 22px;
        font-size: 3.2vw;
        color: #e74d3d;
        background-color: rgba(231, 77, 61, 0.06);
        border-radius: 3.2vw;
        text-align: center;
        white-space: nowrap;
        flex: none;
        float: right;
        margin-top: 10px;
        line-height: 22px;
      }
    }
  }
}
</style>
